package com.diaohaiwen.basic.websockt.controller;

import com.diaohaiwen.basic.websockt.obj.query.NoticeQuery;
import com.diaohaiwen.basic.websockt.obj.vo.NoticeVo;
import com.diaohaiwen.basic.websockt.service.HistoryService;
import com.diaohaiwen.common.enums.NoticeEnum;
import com.diaohaiwen.common.obj.Result;
import com.diaohaiwen.common.obj.page.CurrentPageVo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 历史记录
 *
 * @author 刁海文
 * @since 2023/12/9 22:20
 */
@RestController
@RequestMapping("/history")
public class HistoryController {

    @Resource
    HistoryService historyService;

    @GetMapping("/text")
    public Result<CurrentPageVo<NoticeVo>> pages(NoticeQuery query) {
        return Result.success(historyService.pages(NoticeEnum.TEXT, query));
    }
}
